﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlAgregarGasto.ascx.cs" Inherits="Rendiciones.Web.Custodio.ctrlAgregarGasto" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Button ID="btnAgregarGasto" runat="server" Style="display: none" />
<asp:ModalPopupExtender ID="mpeAgregarGasto"  TargetControlID="btnAgregarGasto" PopupControlID="upAgregarGasto" BackgroundCssClass="vs12_light_opacity" runat="server"/>
<asp:UpdatePanel runat="server" ID="upAgregarGasto">
    <ContentTemplate>
        <div class="vs12_light_form vs12_light_form_modal" style="width:800px;" runat="server" id="pnlAgregarGasto">
            <div class="title">
                <p><asp:Label runat="server" ID="lblTitulo" Text="Agregar gasto"></asp:Label></p>
                <div class="buttons">
                    <asp:Button runat="server" ID="btnCerrarAgregarGasto" CssClass="close" OnClick="BtnCancelarGasto_Click"/>
                </div>
            </div>
            <div class="vs12_light_contenedorMsg" runat="server" id="ErroresAgregarGasto">
                <table style="width: 100%">
                    <tr>
                        <td style="width:24px; vertical-align: top">
                            <asp:Image ID="ImgErroresAgregarGasto" runat="server" ImageUrl="~/img/icons/Mensaje/icoError.png"/> 
                        </td>
                        <td>
                            <asp:Label ID="lblErroresAgregarGasto" runat="server" Text=""/>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="content">
                <asp:HiddenField runat="server" ID="hfIdGasto"/>
                <table>
                    <tr>
                        <td style="width:20%;"><asp:Label ID="lblRendicionNro" runat="server" Text="Gasto Nro."></asp:Label></td>
                        <td style="width:32%;"><asp:Label ID="lbl_NRO_RENDICION" runat="server" Text="1"></asp:Label></td>
                        <td style="width:16%;"><asp:Label ID="lblFechaDocumento" runat="server" Text="Fecha Documento"></asp:Label></td>
                        <td style="width:32%;">
                            <asp:TextBox ID="txtFechaDocumento" runat="server" Width="100px" CssClass="calendario" />
                            <asp:CalendarExtender ID="ceFechaDocumento" TargetControlID="txtFechaDocumento" runat="server" /> 
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblTipoGasto" runat="server" Text="Tipo Gasto"></asp:Label></td>
                        <td><asp:DropDownList ID="DrTipoGasto" runat="server" CssClass="w90p" OnSelectedIndexChanged="DrTipoGasto_SelectedIndexChanged" AutoPostBack="True"/></td>
                        <td><asp:Label ID="lblGastoAsociado" runat="server" Text="Gasto Asociado"></asp:Label></td>
                        <td><asp:DropDownList ID="DrGastoAsociado" CssClass="w90p" runat="server"></asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblTipoDocumento" runat="server" Text="Tipo Documento"></asp:Label></td>
                        <td><asp:RadioButtonList ID="rbtTipoDocumento" runat="server" RepeatDirection="Horizontal" Width="320px" >
                                <asp:ListItem Value="1" Selected="True">Boleta</asp:ListItem>
                                <asp:ListItem Value="2">Factura</asp:ListItem>
                                <asp:ListItem Value="3">Boleta Honorarios</asp:ListItem>
                            </asp:RadioButtonList>

                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblSubTipoDocumento" runat="server" Text="Sub Tipo Documento"></asp:Label></td>
                        <td><asp:DropDownList ID="ddTipoDocumento" runat="server" CssClass="w90p"/></td>
                        <td><asp:Label ID="lblNroDocumento" runat="server" Text="Nro. Documento"></asp:Label></td>
                        <td><asp:TextBox ID="txtNroDocumento" runat="server" Width="100px" ></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblRutProveedor" runat="server" Text="Rut Proveedor/Beneficiario"></asp:Label></td>
                        <td>
                            <asp:TextBox ID="txtRutBeneficiario" runat="server" Width="100px" MaxLength="15"></asp:TextBox>
                            <asp:AutoCompleteExtender ID="acetxtRutBeneficiario" runat="server" TargetControlID="txtRutBeneficiario" ServicePath="~/webservices/WsProveedor.asmx" ServiceMethod="GetProveedores" MinimumPrefixLength="0" CompletionSetCount="20" CompletionInterval="1000" CompletionListCssClass="vs12_light_autocompletelist" OnClientItemSelected="txtRutBeneficiarioItemSelected" CompletionListItemCssClass="vs12_light_autocompletelistitem" CompletionListHighlightedItemCssClass="vs12_light_autocompletelistitemhover"></asp:AutoCompleteExtender>
                            <asp:Button Id="btnSeleccionarProveedor" runat="Server" OnClick="BtnSeleccionarProveedorClick" CssClass="invisible" /> 
                            <script>function txtRutBeneficiarioItemSelected(source, eventArgs) { document.getElementById('<%=btnSeleccionarProveedor.ClientID%>').click(); }</script>
                        </td>
                        <td colspan="2">
                            <asp:TextBox ID="txtNombreProveedor" runat="server" CssClass="w90p" MaxLength="100"/>
                            <br/>
                            <i><asp:Label id="lblProveedorNoExiste" runat="server" Text="El proveedor ingresado no existe" Visible="false"></asp:Label></i>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblDescripcion" runat="server" Text="Descripción"></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtDescripcion" runat="server" Height="50px" TextMode="MultiLine" CssClass="w90p"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblAdjuntar" runat="server" Text="Adjuntar Archivo"></asp:Label></td>
                        <td colspan="3"><asp:FileUpload runat="server" ID="fuAdjuntar"/></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblMontoNeto" runat="server" Text="Monto Neto"></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtMontoNeto" runat="server" Width="100px" OnTextChanged="txtMontoNeto_TextChanged" AutoPostBack="True" CssClass="right"/></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblIVA" runat="server" Text="I.V.A."></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtIVA" runat="server" Width="100px" OnTextChanged="txtIVA_TextChanged" AutoPostBack="True" CssClass="right"/></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblMontoExento" runat="server" Text="Monto Exento"></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtMontoExento" runat="server" Width="100px" AutoPostBack="True" CssClass="right" OnTextChanged="txtMontoExento_TextChanged"/></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblretencion" runat="server" Text="Retencion"></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtRetencion" runat="server" Width="100px" OnTextChanged="txtRetencion_TextChanged" AutoPostBack="True" CssClass="right"/></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblTotalPagado" runat="server" Text="Total Pagado"></asp:Label></td>
                        <td colspan="3"><asp:TextBox ID="txtTotalPagado" runat="server" Width="100px" ReadOnly="True" CssClass="right"/></td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <br />
                            <asp:Button ID="BtnGuardarGasto" runat="server" CssClass="boton w100" Text="Guardar" OnClick="BtnGuardarGasto_Click" />
                            <asp:Button ID="BtnCancelarGasto" runat="server" CssClass="boton w100" Text="Cancelar" OnClick="BtnCancelarGasto_Click" />
                        </td>
                    </tr>
                </table>
                <div class="h30"></div>
            </div>
        </div>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="DrTipoGasto" EventName="SelectedIndexChanged" />
    </Triggers>
</asp:UpdatePanel>
